home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / DEVICES / KEYBOARD.PAS next >
Pascal/Delphi Source File  |  1996-08-16  |  1KB  |  28 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Demonstration; keyboard handling
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBDEF, EFLIBKBD;
  10.      { Incorporate EFLIBDEF and EFLIBKBD units }
  11.  
  12. begin
  13.      { Wait for ALT to be pressed }
  14.      WriteLn ('Welcome to EFLIB - press the ALT key!');
  15.      repeat until Keyboard.AltPressed;
  16.  
  17.      { Wait for CTRL to be pressed }
  18.      WriteLn ('And now press the CTRL key!');
  19.      repeat until Keyboard.CtrlPressed;
  20.  
  21.      { Wait for a key press; look at (peek) the key and check character and
  22.        then read the key from the keyboard buffer and return it's scan code. }
  23.      WriteLn ('... and any of your own choice!');
  24.      repeat until Keyboard.KeyPressed; { Wait for a key }
  25.      WriteLn ('You pressed: ', Keyboard.PeekKey, ' [', Keyboard.ReadScanCode, ']');
  26.  
  27.      WriteLn ('Good bye!');
  28. end.